home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / aros / source / exec / internal / m68k / m68k-native / enable.s < prev    next >
Encoding:
Text File  |  1996-07-16  |  1.2 KB  |  68 lines

  1. |*****************************************************************************
  2. |
  3. |   NAME
  4. |
  5. |    __AROS_LH0(void, Enable,
  6. |
  7. |   LOCATION
  8. |    struct ExecBase *, SysBase, 21, Exec)
  9. |
  10. |   FUNCTION
  11. |    This function reenables the delivery of interrupts after a call to
  12. |    Disable().
  13. |
  14. |   INPUTS
  15. |
  16. |   RESULT
  17. |
  18. |   NOTES
  19. |    This function preserves all registers.
  20. |
  21. |    This function may be used from interrupts.
  22. |
  23. |   EXAMPLE
  24. |
  25. |   BUGS
  26. |
  27. |   SEE ALSO
  28. |    Forbid(), Permit(), Disable()
  29. |
  30. |   INTERNALS
  31. |
  32. |   HISTORY
  33. |
  34. |******************************************************************************
  35.  
  36.     Switch        =    -0x24
  37.     IDNestCnt   =    0x126
  38.     TDNestCnt   =    0x127
  39.     AttnResched =    0x12a
  40.     INTENA        =    0xdff09a
  41.     INTEN        =    0x4000
  42.     SET        =    0x8000
  43.  
  44.     .globl    _Exec_Enable
  45. _Exec_Enable:
  46.     | decrement nesting count and return if there are Disable()s left
  47.     subqb    #1,a6@(IDNestCnt)
  48.     jpl    end
  49.  
  50.     | reenable interrupts
  51.     movew    #INTEN+SET,INTENA
  52.  
  53.     | return if there are no delayed switches pending.
  54.     tstb    a6@(AttnResched+1)
  55.     jpl    end
  56.  
  57.     | if TDNestCnt is not -1 taskswitches are still forbidden
  58.     tstb    a6@(TDNestCnt)
  59.     jpl    end
  60.  
  61.     | Unset delayed switch bit and do the delayed switch
  62.     bclr    #7,a6@(0x12b)
  63.     jsr    a6@(Switch)
  64.  
  65.     | all done.
  66. end:    rts
  67.  
  68.